<?php
/* --------------------------------------------------------------
   gm_privacy.php 2011-06-09 gambio
   Gambio GmbH
   http://www.gambio.de
   Copyright (c) 2011 Gambio GmbH
   Released under the GNU General Public License (Version 2)
   [http://www.gnu.org/licenses/gpl-2.0.html]
   --------------------------------------------------------------


   based on:
   (c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
   (c) 2002-2003 osCommerce(account_password.php,v 1.1 2003/05/19); www.oscommerce.com
   (c) 2003	 nextcommerce (account_password.php,v 1.14 2003/08/17); www.nextcommerce.org
   (c) 2003 XT-Commerce - community made shopping http://www.xt-commerce.com ($Id: account_password.php 1218 2005-09-16 11:38:37Z mz $)

   Released under the GNU General Public License
   ---------------------------------------------------------------------------------------*/

include ('includes/application_top.php');
require_once (DIR_FS_INC.'xtc_date_short.inc.php');

// create smarty elements
$smarty = new Smarty;
// include boxes

$breadcrumb->add(NAVBAR_TITLE_1_ACCOUNT_PASSWORD, xtc_href_link(FILENAME_ACCOUNT, '', 'SSL'));
$breadcrumb->add(GM_CONFIRMATION_PRIVACY, xtc_href_link('gm_privacy.php', '', 'SSL'));

require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');
// include needed functions

if (!isset ($_SESSION['customer_id']))
	xtc_redirect(xtc_href_link(FILENAME_LOGIN, '', 'SSL'));

require (DIR_WS_INCLUDES.'header.php');

$gm_query = xtc_db_query("
							SELECT
								gm_privacy,
								gm_privacy_date
							FROM " .
								TABLE_CUSTOMERS ."
							WHERE
								customers_id = '".(int) $_SESSION['customer_id']."'
						");

$gm_array = xtc_db_fetch_array($gm_query);

$gm_array['gm_privacy'] = str_replace('<br />', "\n", $gm_array['gm_privacy']);

$gm_array['gm_privacy'] = strip_tags($gm_array['gm_privacy']);
$gm_array['gm_privacy'] = trim($gm_array['gm_privacy']);
$gm_array['gm_privacy'] = str_replace("\t", "", $gm_array['gm_privacy']);
$gm_array['gm_privacy'] = str_replace("\r", "", $gm_array['gm_privacy']);
$gm_array['gm_privacy'] = trim($gm_array['gm_privacy']);

$smarty->assign('GM_PRIVACY',		xtc_draw_textarea_field('gm_privacy', 'soft', 45, 6, $gm_array['gm_privacy'], 'readonly="readonly"'));

$t_privacy_array = array();
$t_privacy_array = array('NAME' => 'gm_privacy',
						'TEXT' => $gm_array['gm_privacy']);
$smarty->assign('privacy_data', $t_privacy_array);

$smarty->assign('GM_PRIVACY_DATE',	xtc_date_short($gm_array['gm_privacy_date']));

$smarty->assign('BUTTON_BACK', '<a href="'.xtc_href_link(FILENAME_ACCOUNT, '', 'SSL').'">'.xtc_image_button('button_back.gif', IMAGE_BUTTON_BACK).'</a>');
$smarty->assign('BUTTON_BACK_LINK', xtc_href_link(FILENAME_ACCOUNT, '', 'SSL'));

$smarty->assign('language', $_SESSION['language']);

$smarty->caching = 0;
$main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/gm_privacy.html');

$smarty->assign('language', $_SESSION['language']);
$smarty->assign('main_content', $main_content);
$smarty->caching = 0;
if (!defined(RM))
	$smarty->load_filter('output', 'note');
$smarty->display(CURRENT_TEMPLATE.'/index.html');
include ('includes/application_bottom.php');
?>